<!--{template admin/header}-->
<body id="homepage">
    <div id="breadcrumb">
        <ul>
            <li><img src="static/img/icons/icon_breadcrumb.png"
                     alt="Location" /></li>
            <li><strong>位置:</strong></li>
            <li><a href="admin.php">主页</a> - 话题查询</li>
        </ul>
    </div>
    <div id="rightside" class="count_topic user_info">
        <div class="contentcontainer">
            <div class="headings altheading">
                <h3>话题查询</h3>
            </div>
            <div class="contentbox">
                <div class="extrabottom">
                    <form method="get" action="admin.php" class="form-inline" role="form" >
						<div class="input-prepend" id="count_tid">
							<span class="add-on">话题ID</span>
							<input class="span2" id="prependedInput" type="text" placeholder="TID" name="tid" value="{$topicInfo['tid']}" >
						</div>
                         <input type="hidden" value="topic" name="ac">
                         <input type="hidden" value="1" name="query">
                         <input type="submit" value="查询" class="btn" /> 
                    </form>
                </div>
                <div style="clear: both;"></div>
                <table width="100%" class="table table-striped">
                    <thead>
                        <tr>
                            <th>发布者</th>
                            <th>话题标题</th>
                            <th>评论数</th>
                            <th>查看数</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    	<!--{if $topicInfo}-->
                    	<tr>
                    		<td><a target="_blank" title="$topicInfo['user']['nickname']" href="admin.php?ac=user&uid={$topicInfo['user']['uid']}">{$topicInfo['user']['nickname']}</a></td>
                    		<td><a target="_blank" title="$topicInfo['title']" href="admin.php?ac=count_topic&op=getTopicInfo&tid={$topicInfo['tid']}">{$topicInfo['title']}</a></td>
                    		<td>{$topicInfo[res_num]}</td>
                    		<td>{$topicInfo[view_num]}</td>
                    		<td><a href="javascript:;" class="correct" data-tid={$topicInfo['tid']}>点击校正话题查看数</a></td>
                    	</tr>
                    	<!--{/if}-->
                    </tbody>
                </table>
                <div style="clear: both;"></div>
            </div>
        </div>
    </div>
    <!--{template admin/leftside}-->
    <!--{template admin/footer}-->
    <script type="text/javascript">
    
    $(document).on("click",".correct",function(){
        var data = $(this).data();
        var tid = data.tid;
        
        $.get(  "admin.php", {
                tid : tid,
                ac     : 'topic',
                op     : 'correctTopic'
                },function(data) {
                    if (data == 1) {
                        alert('校正成功');
                    }else{
                        alert('校正失败');
                    }
                });
    });
    
    </script>